/**
 * @filename:${entityName}ServiceImpl ${createTime}
 * @project ${project}  ${version}
 * Copyright(c) 2018 ${author} Co. Ltd.
 * All right reserved.
 */
package ${serviceImplUrl};

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yz.base.boot.entity.AppPage;
import ${entityUrl}.${entityName};
import ${daoUrl}.${entityName}Dao;
import ${serviceUrl}.${entityName}Service;

/**
 * ${entityComment}—SERVICEIMPL.
 *
 * @author <a href="mailto:${email}">${author}</a>
 * @date ${createTime}
 * @since ${version}
 **/
@Service
public class ${entityName}ServiceImpl implements ${entityName}Service {

	@Autowired
	public ${entityName}Dao ${objectName}Dao;

	/**
	 * 查询${entityComment}对象.
	 *
	 * @param id
	 * @return ${entityName}
	 */
	@Override
	public ${entityName} selectByPrimaryKey(${idType} id) {
		return ${objectName}Dao.selectByPrimaryKey(id);
	}

	/**
	 * 删除${entityComment}对象.
	 *
	 * @param id
	 * @return int
	 */
	@Override
	public int deleteByPrimaryKey(${idType} id) {
		return ${objectName}Dao.deleteByPrimaryKey(id);
	}

	/**
	 * 添加${entityComment}对象.
	 *
	 * @param ${objectName}
	 * @return int
	 */
	@Override
	public int insertSelective(${entityName} ${objectName}) {
		return ${objectName}Dao.insertSelective(${objectName});
	}

	/**
	 * 修改${entityComment}对象.
	 *
	 * @param ${objectName}
	 * @return int
	 */
	@Override
	public int updateByPrimaryKeySelective(${entityName} ${objectName}) {
		return ${objectName}Dao.updateByPrimaryKeySelective(${objectName});
	}

	/**
	 * 查询${entityComment}集合.
	 *
	 * @param ${objectName}
	 * @return List<${entityName}>
	 */
	@Override
	public List<${entityName}> query${entityName}List(${entityName} ${objectName}) {
		return ${objectName}Dao.query${entityName}List(${objectName});
	}

	/**
	 * 分页查询${entityComment}.
	 *
	 * @param page
	 * @return PageInfo<${entityName}>
	 */
	@Override
	public PageInfo<${entityName}> get${entityName}BySearch(AppPage<${entityName}> page) {
		// TODO Auto-generated method stub
		PageHelper.startPage(page.getPageNum(), page.getPageSize());
		List<${entityName}> list = ${objectName}Dao.query${entityName}List(page.getParam());
		PageInfo<${entityName}> pageInfo = new PageInfo<${entityName}>(list);
		return pageInfo;
	}
}
